package com.infitecs.eyas.oncefan.service;

import com.infitecs.eyas.oncefan.dao.OnceFanSummaryDao;
import com.infitecs.eyas.oncefan.model.OnceFanSummary;
import com.infitecs.eyas.session.SessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by pzw on 2015/8/29.
 */
@Service
public class OnceFanSummaryService {

    @Autowired
    private OnceFanSummaryDao onceFanSummaryDao;

    @Autowired
    private SessionService sessionService;

    public void insertNewSummary() {
        onceFanSummaryDao.insertNewSummary(sessionService.getCaseId());
    }

    public OnceFanSummary getOnceFanSummary() {
        return onceFanSummaryDao.getOnceFanSummary(sessionService.getCaseId());
    }

    public void updateParam(OnceFanSummary onceFanSummary) {
        int caseId = sessionService.getCaseId();
        onceFanSummary.setCaseId(caseId);
        onceFanSummaryDao.updateParam(onceFanSummary);
    }

}
